<?php

abstract class AbstractCsvHydrator  {
    
  /**
   * @return string
   */
  abstract function hydrate();
  
  public static function arrayToCsv(array $array) {
    foreach($array as $k => $v) {
      if(strstr($v, ';')) {
        $array[$k] = '"'.$v.'"';
      }
    }
    $csv = implode(';', $array) . self::getLineBreak();
    return $csv;
  }
  
  public static function getLineBreak() {
    return "\n";
  }
}